"use strict";

const Controller = require("egg").Controller;
/**
 * @Controller Test
 */
class TestController extends Controller {
  /**
   * @summary 测试
   * @description description 这是一个测试/test接口
   * @Router GET /test
   */
  async index() {
    const { ctx } = this;
    ctx.body = "hi,  test";
  }
  async demo() {
    /**
     * @summary 测试 demo
     * @description configsingle 这是一个测试test/demo接口
     * @Router GET /test/demo
     * @Request body createResource *body resourceInfo
     * @Request header string access_token
     * @Response 200 baseResponse
     */
    const { ctx } = this;
    ctx.body = {
      code: 200,
      data: {
        name: "demo test",
        date: new Date().toLocaleDateString(),
        random: Math.random(10),
      },
      msg: "success hi, test",
    };
  }
}

module.exports = TestController;
